#!/usr/bin/python3

"""
去重!!!
name,id

数据 可能落后 于 bash中的了
"""

douyu=[
"神乐影院-1台,85894",
"神乐影院-2台,122402",
"神乐-爱情公寓,6566658",
"庆帝,5062195",
"不可能 我二弟天下无敌,2838296",

"邵氏影院㊣版,4246519",
"邵氏影院㊣版,4246519",
"4k 影院剧场,9249162",
"凌儿影院,1377142",
"吃米滴虫,315457",
"冰冰经典,74374",
"星爷影院,508118",
"凌儿影院,1377142",
"麓山迷踪,4505431",
"瑶瑶恐怖,2935323",
"怡寶影院,434971",
"小黛兮影,11553944",
"萌小鬼片,3928",
"神乐影剧,122402",
"可乐影院,20415",
"小宇60帧,323876",
"恐怖惊悚,96577",
"電影劇場,7575350",
"國語電影,2436390",
"豆瓣高分,8770422",
"花卷陪看,52787",
"漫威剧情,6140589",
"霍格沃茨,8814650",
"鱼宝恐怖,1165374",
"鬼片恐怖,2935323",
"小u*鬼片,96577",
"吃奶滴虫,263824",
"变种人片,9651304",
"喜剧电影,9292492",
"女神电影,747764",
"华语经典,434971",
"避风影院,9826611",
"欧美大片,2793084",
"贝爷max,4332",
"贝爷影厅,252802",
"译制国语,2436390",
"小宇60帧,323876",
"恐怖惊悚,96577",
# "電影劇場,7575350",
"國語電影,2436390",
"豆瓣高分,8770422",
"花卷陪看,52787",
"漫威剧情,6140589",
# "霍格沃茨,8814650",
"鱼宝恐怖,1165374",
"鬼片恐怖,2935323",
"小U鬼片,96577",
"菜园惊险,1735337",
"吃奶滴虫,263824",

"变种人片,9651304",
"喜剧电影,9292492",
"女神电影,747764",
"华语经典,434971",
"避风影院,9826611",
"星星影院,315131",
"欧美大片,2793084",
"贝爷影厅,252802",
"译制国语,2436390",

'胡歌,5448413',
'金庸武侠、古装神剧,338759',
'影视剧】总有一部你喜欢的经典影视,11774356',
'牛叔】N分钟带你看完大片,2758565',
'1000部悬疑电影,9601429',
'港剧天地1,4290711',
'港剧天地2,5522351',
'港剧天地3,5261342',
'纪晓岚,9071554',
'经典电影】 历届奥斯卡最佳影片盘点解说,9402110',
'小片片】国产经典剧集专属直播间,10011547',
# '迟到的侦探？？,11954507',
'令狐冲，经典武侠,11741883',
# '花开】射雕 靖哥哥 黄蓉,11651489',
'杀死燕双鹰，活捉狄仁杰！,3439096',
'台配-名蒸蛋柯南,12134650',
'柯南探案解说中,9065302',
'☆卡卡罗特☆,7286439',
'带您进入Fatal飞雪的动漫小屋,8813596',
'大秦国要搞大事,9388931',
'史君说剧】史君说尽天下好剧,9419771',
'经典高分电影,7254536',
'霍格沃茨】伟大引起嫉妒，嫉妒导致怨毒,8814650',
'刘德华】庆祝华仔出道40周年,2516864',
'步惊云】金鳞岂是池中物，一遇风云便化龙,9290755',
'使徒行者,7810803',
'重生小说合集】重生 系统 末日 仙侠,562225',
'金庸经典,12128227',
'三国,12124964',
'漫威迷集合,1713615',
'电影film,9292499',
'电影剧场 越狱,7575350',
'大坑】悬疑推理视频解说,9440339',
'小叮当】童年经典动画片,9445279',
'虫哥】魔性吐槽童年回忆,8915074',


"JJ斗地主,488743",

]

#################
store={

}

keys=[]
names={}
##########################

for d in douyu:
    d=d.split(",")
    key=d[-1]
    name=" ".join(d[:-1])
    name.replace("'","")
    count=0
    if store.get(key) is None:
        while True:
            if names.get(name) is None:
                names[name]=True
                break
            else:
                count+=1
                name=f"{name}-{count}"
        store[key]=name
        keys.append(key)
        continue
    print(f"key={key} :: old={store.get(key)}, now={name}")

print("\n\n")
for key in keys:
    print(f"'{store.get(key)},{key}'")
